<!DOCTYPE html>
<html>
<header>
  <meta charset="utf-8" />
  <script>

    function getFoo(message) {
      return new Promise(function (resolve, reject) {
        resolve(message);
      });
    }
    setTimeout(function(){console.log("----aa----")},1000);
    
    const mypromise = getFoo('Promise_11');
    mypromise.then((sucess) => {
      console.log(sucess);
    }, (err) => {

    });

    const mypromise2 = getFoo('Promise_22');
    mypromise2.then((sucess) => {
      console.log(sucess);
    }, (err) => {

    });

    console.log("11");
    console.log("22");
    for(let i=23;i<=1000;i++){
      console.log("------------------")
    }

    setTimeout(function(){console.log("----bb----")},1000);


  </script>
</header>

<body>
</body>

</html>